Ext.define('YX.core.util.GppReport', {
	 extend : 'Ext.panel.Panel',
	 closable : true,
	 alternateClassName : ['YX.Report'],
	 initComponent : function() {
	  this.callParent();

	  var rptName = this.rptName;
	  if (!Ext.isEmpty(rptName)) {
		 if (!Ext.String.endsWith(rptName, '.grf', true)) {
		  rptName += '.grf';
		 }

		 var rptId = '_gppreport_' + rptName.substring(0, rptName.lastIndexOf('.'));

		 if (Ext.isIE)
		  typeid = 'classid="clsid:ABB64AAC-D7E8-4733-B052-1B141C92F3CE" ' + gr_CodeBase;
		 else
		  typeid = 'type="application/x-grplugin6-printviewer"';

		 this.update('<object id="' + rptId + '" ' + typeid
		   + ' width="100%" height="100%"><param name="AutoRun" value=false><param name="ReportURL" value="' + 'rpt/'
		   + rptName + '"><param name="DataURL" value="rpt/xmlCustomer.txt"><param name="SerialNo" value="' + gr_SerialNo
		   + '"><param name="UserName" value="' + gr_UserName + '"></object>');

		 this.on('afterrender', this.onAfterRender, this);
	  }
	 },/*
	 onBoxReady : function() {
	 alert(1);
	 var rptName = this.rptName;
	 if (!Ext.isEmpty(this.data)) {
	 if (!Ext.isEmpty(rptName)) {
	  if (!Ext.String.endsWith(rptName, '.grf', true)) {
	  rptName += '.grf';
	  }

	  var rptId = '_gppreport_' + rptName.substring(0, rptName.lastIndexOf('.'));

	  var report = Ext.getDom(rptId);
	  //report.Stop();
	  //report.Report.LoadDataFromXML(Ext.encode(this.data));
	  report.Report.ParameterByName("bizNo").AsString = "WWWWWWWW";
	  report.Report.ParameterByName("bizUser").AsString = "赵晓伟s";
	  report.Start();
	  //report.refresh();
	 }
	 }
	 },*/
	 onAfterRender : function() {
	  var rptName = this.rptName;
	  if (!Ext.isEmpty(this.data)) {
		 if (!Ext.isEmpty(rptName)) {
		  if (!Ext.String.endsWith(rptName, '.grf', true)) {
			 rptName += '.grf';
		  }

		  var rptId = '_gppreport_' + rptName.substring(0, rptName.lastIndexOf('.'));

		  var report = Ext.getDom(rptId);
		  //report.Stop();
		  try {
			 var data = this.data;
			 report.Report.LoadDataFromXML(data);
			 report.Start();
		  } catch (ex) {
		  }
		  //report.refresh();
		 }
	  }
	 }
  });